package com.zhangjingcheng.yunyixia.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhangjingcheng.yunyixia.pojo.entity.Store;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface StoreMapper extends BaseMapper<Store> {
    @Select("select id, user_id, file_id, del_flag, recover_time, create_time, last_update_time " +
            "from store where file_id = #{fileId} and user_id = #{userId}")
    Store selectByFileId(Integer fileId, Integer userId);


    /**
     * 统计文件id
     * @param id
     */
    @Select("select count(*) from store where file_id = #{id}")
    Integer countFileId(Integer id);

}
